package com.nyist.myticket;

import com.nyist.myticket.core.base.ApplicationContextFactory;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@MapperScan("com.nyist.myticket.**.mapper")
@ComponentScan("com.nyist.myticket")
@EnableTransactionManagement
@Slf4j
public class MyticketApplication {

    public static void main(String[] args) {
        try {
            ApplicationContext context = SpringApplication.run(MyticketApplication.class, args);
            //加载配置文件，注册订单处理侦听
            ApplicationContextFactory.setApplicationContext(context);
        } catch (Throwable e) {
            log.error("系统启动失败", e.getMessage());
        }
    }

}
